loop object number

Hello Forums,

how can i make a loop from object heading to the next object heading  , i want the objects between two object heading ?

is that with "object number" possible ?

 

Regards ,

neven

 


Control17 - Thu Aug 24 06:48:14 EDT 2017

Re: loop object number
Mike.Scharnow - Thu Aug 24 07:03:09 EDT 2017

DXL Reference manual, page 375, loop for object in object.

I think it's time that now that you gained some more insight into DXL, that you re-read the complete DXL manual to understand more details. In addition, you should read the DXL files provided by IBM in "c:\Program Files\IBM\Rational\DOORS\9.6\lib\dxl" (some inc files are encrypted, but not all of them) and try to understand them. Also, there are a lot of DXL scripts available (e.g at smartdxl.com or baselinesinc.com) that you can read to get more into the way how to write DXL scripts. And remember that you need a thorough understanding of the DOORS concepts before you begin programming in DXL....

 

Regards,
Mike

Re: loop object number
Control17 - Fri Aug 25 03:23:45 EDT 2017

Mike.Scharnow - Thu Aug 24 07:03:09 EDT 2017

DXL Reference manual, page 375, loop for object in object.

I think it's time that now that you gained some more insight into DXL, that you re-read the complete DXL manual to understand more details. In addition, you should read the DXL files provided by IBM in "c:\Program Files\IBM\Rational\DOORS\9.6\lib\dxl" (some inc files are encrypted, but not all of them) and try to understand them. Also, there are a lot of DXL scripts available (e.g at smartdxl.com or baselinesinc.com) that you can read to get more into the way how to write DXL scripts. And remember that you need a thorough understanding of the DOORS concepts before you begin programming in DXL....

 

Regards,
Mike

thank u for your answer and your advice , i do my best.

 

Regards,

neven

Re: loop object number
Control17 - Fri Aug 25 08:18:14 EDT 2017

Mike.Scharnow - Thu Aug 24 07:03:09 EDT 2017

DXL Reference manual, page 375, loop for object in object.

I think it's time that now that you gained some more insight into DXL, that you re-read the complete DXL manual to understand more details. In addition, you should read the DXL files provided by IBM in "c:\Program Files\IBM\Rational\DOORS\9.6\lib\dxl" (some inc files are encrypted, but not all of them) and try to understand them. Also, there are a lot of DXL scripts available (e.g at smartdxl.com or baselinesinc.com) that you can read to get more into the way how to write DXL scripts. And remember that you need a thorough understanding of the DOORS concepts before you begin programming in DXL....

 

Regards,
Mike

Hello,

i tried to use object in object loop , with this code i get It_2 , It_4 for second loop

 i do not want the parent o , i want to find the objects below object Heading It_3 in this case , how  ? 

how can i find if my absNum object Heading is ?

 

Abs object number  
It_1 1 1 basic
It_2 1.1 1.1 basics definition
It_3 1.1.0-1 x = 1 , y = 2
It_4 1.1.1 1.1.1 basics function

 

 

pragma runLim, 0
Module m = current
Object o = current
Object po = parent o  
filtering off

Skip objList = create() 
.......
......


int absNum
for o in m do { 
absNum = o."Absolute Number"
if (find (objList,absNum)){
print "[It_" absNum "]" " this absNum is object Heading"  // how can i find that this absNum object Heading is ?
}
for o in po do {
print "this  It_ " o."Absolute Number" " is below the object heading" // i do not want parent object , i want die object below object heading till the next parent ?
}

 

 

please help

neven

Re: loop object number
Mike.Scharnow - Fri Aug 25 14:06:13 EDT 2017

It is difficult to answer when the complete scope, the idea behind the script is not clear.

What exactly shall your script find, how is it started, which are the exact circumstances, what are your requirements to the script?

What do you mean by "below"? You do know that DOORS distinguishes between "below" and "after"? Below means "one level deeper", After means "a successor  on the same level".

In your example, the levels of your objects are 1,2,3,3, so there is one object directly below It_1, two objects directly below It_2 and one object after It_3.

You can for example navigate from one object to the next using first, last, next, parent, previous (see: vertical navigation in DXL manual) or first sibling, last sibling, next sibling, previous sibling (see horizontal navigation in DXL manual).

For answering your question as to whether an object is a heading or not: you already used this in one of your previous scripts. When playing around with DOORS you will notice that an object can have it's text filled or it's heading or both. When an object's heading is filled, the object displays its object number. So, it's just a comparison if (o."Object Heading" "" == "") -> no heading.

So, let me guess: you need a script that for every object in the module checks: if the object does not have a heading and it has a direct successor which does have a heading, print a warning. Is that what you want?

If so, the code would be 

 

 

pragma runLim, 0
Module m = current
Object o
filtering off

for o in m do {
    if (o."Object Heading" "" == "") {
        Object oSibling = next sibling o
        if (!null oSibling) {
            if (oSibling."Object Heading" "" != "") {
                print (identifier o) " is not a heading but its sibling " (identifier oSibling) " is. This is not so nice\n"
            }
        }
    }
}

 

Re: loop object number
Control17 - Mon Aug 28 05:55:52 EDT 2017

Mike.Scharnow - Fri Aug 25 14:06:13 EDT 2017

It is difficult to answer when the complete scope, the idea behind the script is not clear.

What exactly shall your script find, how is it started, which are the exact circumstances, what are your requirements to the script?

What do you mean by "below"? You do know that DOORS distinguishes between "below" and "after"? Below means "one level deeper", After means "a successor  on the same level".

In your example, the levels of your objects are 1,2,3,3, so there is one object directly below It_1, two objects directly below It_2 and one object after It_3.

You can for example navigate from one object to the next using first, last, next, parent, previous (see: vertical navigation in DXL manual) or first sibling, last sibling, next sibling, previous sibling (see horizontal navigation in DXL manual).

For answering your question as to whether an object is a heading or not: you already used this in one of your previous scripts. When playing around with DOORS you will notice that an object can have it's text filled or it's heading or both. When an object's heading is filled, the object displays its object number. So, it's just a comparison if (o."Object Heading" "" == "") -> no heading.

So, let me guess: you need a script that for every object in the module checks: if the object does not have a heading and it has a direct successor which does have a heading, print a warning. Is that what you want?

If so, the code would be 

 

 

pragma runLim, 0
Module m = current
Object o
filtering off

for o in m do {
    if (o."Object Heading" "" == "") {
        Object oSibling = next sibling o
        if (!null oSibling) {
            if (oSibling."Object Heading" "" != "") {
                print (identifier o) " is not a heading but its sibling " (identifier oSibling) " is. This is not so nice\n"
            }
        }
    }
}

 

Hello Mike ,

thank u for your reply , i have objects in my skiplist and i want to check if this object is object Heading is ,in this case i want to find the object below but nur the objects with object text (not heading )

for example

It_1 is in my skiplist , in this case i get for line 16

1 this Identifier is object heading

now for It_1 , i  need  to find It_ 3, 4 , how can i make this ?

identifier

object number  
It_1 1 1 basic
It_2 1.1 1.1 basics definition
It_3 1.1.0-1 x = 1 , y = 2
It_4 1.1.0-2 c = 1 , d = 3
It_5 1.2 1.2 C++

 

 

pragma runLim, 0
Module m = current
Object o = current 
filtering off

Skip objList = create() 
.......
......

int absNum
for o in m do { 
string oh = o."Object Heading"
if (oh != ""){ 
 absNum = o."Absolute Number"
 if (find (objList,absNum)) {
 print  absNum  "this identifier is object heading" "\n"
}
}
}

 

Regards,

neven

 

Re: loop object number
Mike.Scharnow - Mon Aug 28 06:54:26 EDT 2017

Control17 - Mon Aug 28 05:55:52 EDT 2017

Hello Mike ,

thank u for your reply , i have objects in my skiplist and i want to check if this object is object Heading is ,in this case i want to find the object below but nur the objects with object text (not heading )

for example

It_1 is in my skiplist , in this case i get for line 16

1 this Identifier is object heading

now for It_1 , i  need  to find It_ 3, 4 , how can i make this ?

identifier

object number  
It_1 1 1 basic
It_2 1.1 1.1 basics definition
It_3 1.1.0-1 x = 1 , y = 2
It_4 1.1.0-2 c = 1 , d = 3
It_5 1.2 1.2 C++

 

 

pragma runLim, 0
Module m = current
Object o = current 
filtering off

Skip objList = create() 
.......
......

int absNum
for o in m do { 
string oh = o."Object Heading"
if (oh != ""){ 
 absNum = o."Absolute Number"
 if (find (objList,absNum)) {
 print  absNum  "this identifier is object heading" "\n"
}
}
}

 

Regards,

neven

 

The loop type you would have to use is "for object in object".

To find all children of children of children, it is probably the easiest way to create a recursive function.